<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>酷妈妈商城</title>
<style type="text/css">
table {
	border: 1px solid #eee;
}

.line {
	border-top: 1px solid #eee;
}
</style>
</head>
<body>
	<h1>订单排行榜</h1>
	<h2>
		<a href="<%=basePath %>export">导出榜单</a>
	</h2>
	<c:if test="${empty ranks}">
		<h2>没有人购买</h2>
	</c:if>

	<table class="line" width="90%">
		<tr>
			<th>产品编号</th>
			<th>产品名称</th>
			<th>产品单价</th>
			<th>购买数量</th>
		</tr>
		<c:forEach var="rank" items="${ranks}" varStatus="status">
			<tr>
				<td class="line">${rank.product_id }</td>
				<td class="line">${rank.product.name }</td>
				<td class="line">${rank.product.price }</td>
				<td class="line">${rank.buynum }</d>
			</tr>
		</c:forEach>
	</table>
</body>
</html>